/*
 Navicat Premium Data Transfer

 Source Server         : local
 Source Server Type    : MySQL
 Source Server Version : 80033
 Source Host           : localhost:3306
 Source Schema         : yueyin-website-dev

 Target Server Type    : MySQL
 Target Server Version : 80033
 File Encoding         : 65001

 Date: 11/07/2023 15:38:15
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for pos_category
-- ----------------------------
DROP TABLE IF EXISTS `pos_category`;
CREATE TABLE `pos_category` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键id，自增',
  `cateName` varchar(30) COLLATE utf8mb4_general_ci NOT NULL COMMENT '分类名称',
  `status` tinyint(1) DEFAULT '1' COMMENT '状态 true：有效  false：冻结',
  `type` int DEFAULT NULL COMMENT '类型 1：产品 2：案例 3：资讯',
  `sort` int DEFAULT NULL COMMENT '排序',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of pos_category
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for pos_folder
-- ----------------------------
DROP TABLE IF EXISTS `pos_folder`;
CREATE TABLE `pos_folder` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键id，自增',
  `folderName` varchar(30) COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件夹名称',
  `type` int DEFAULT '1' COMMENT '类型 1：图片 2：视频',
  `sort` int DEFAULT NULL COMMENT '排序',
  `isSys` tinyint(1) DEFAULT '0' COMMENT '是否系统默认 true:是 false:否',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of pos_folder
-- ----------------------------
BEGIN;
INSERT INTO `pos_folder` (`id`, `folderName`, `type`, `sort`, `isSys`) VALUES (1, '系统图片', 1, NULL, 1);
INSERT INTO `pos_folder` (`id`, `folderName`, `type`, `sort`, `isSys`) VALUES (2, '系统视频', 2, NULL, 1);
COMMIT;

-- ----------------------------
-- Table structure for pos_photo
-- ----------------------------
DROP TABLE IF EXISTS `pos_photo`;
CREATE TABLE `pos_photo` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键id，自增',
  `folderId` int NOT NULL COMMENT '文件夹id',
  `url` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '图片路径',
  `fullUrl` varchar(255) COLLATE utf8mb4_general_ci NOT NULL COMMENT '图片全路径',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of pos_photo
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for pos_tag
-- ----------------------------
DROP TABLE IF EXISTS `pos_tag`;
CREATE TABLE `pos_tag` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键id，自增',
  `tagName` varchar(30) COLLATE utf8mb4_general_ci NOT NULL COMMENT '标签名称',
  `status` tinyint(1) DEFAULT '1' COMMENT '状态 true：有效  false：冻结',
  `type` int DEFAULT NULL COMMENT '类型 1：产品 2：案例 3：资讯',
  `sort` int DEFAULT NULL COMMENT '排序',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of pos_tag
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for SequelizeMeta
-- ----------------------------
DROP TABLE IF EXISTS `SequelizeMeta`;
CREATE TABLE `SequelizeMeta` (
  `name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
  PRIMARY KEY (`name`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

-- ----------------------------
-- Records of SequelizeMeta
-- ----------------------------
BEGIN;
INSERT INTO `SequelizeMeta` (`name`) VALUES ('20220902100434-init-sys-users.js');
INSERT INTO `SequelizeMeta` (`name`) VALUES ('20220902100508-init-sys-menu.js');
INSERT INTO `SequelizeMeta` (`name`) VALUES ('20220902100516-init-sys-role.js');
INSERT INTO `SequelizeMeta` (`name`) VALUES ('20220902100524-init-sys-user-role.js');
INSERT INTO `SequelizeMeta` (`name`) VALUES ('20220902100550-init-sys-role-menu.js');
INSERT INTO `SequelizeMeta` (`name`) VALUES ('20220903084339-init-pos-folder.js');
INSERT INTO `SequelizeMeta` (`name`) VALUES ('20220903084459-init-pos-photo.js');
INSERT INTO `SequelizeMeta` (`name`) VALUES ('20220906102529-init-pos-categroy.js');
INSERT INTO `SequelizeMeta` (`name`) VALUES ('20220906102537-init-pos-tag.js');
COMMIT;

-- ----------------------------
-- Table structure for sys_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_menu`;
CREATE TABLE `sys_menu` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键id，自增',
  `parentId` int DEFAULT '0' COMMENT '父菜单ID 一级菜单为0',
  `perm` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '权限值',
  `title` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '菜单名称',
  `name` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '路由名称',
  `path` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '路由路径',
  `component` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '组件',
  `icon` varchar(100) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '图标',
  `type` int DEFAULT '0' COMMENT '菜单类型  0目录 1菜单  2按钮 3外部链接',
  `status` tinyint(1) DEFAULT '1' COMMENT '状态 true：有效  false：冻结',
  `sort` int DEFAULT NULL COMMENT '排序',
  PRIMARY KEY (`id`),
  UNIQUE KEY `perm` (`perm`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of sys_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (1, 0, 'sys', '系统设置', 'Baisc', '/system', NULL, 'SettingOutlined', 0, 1, NULL);
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (2, 1, 'sys:menu', '菜单管理', 'Menu', '/system/menu', 'Menu', NULL, 1, 1, 3);
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (3, 2, 'sys:menu:create', '新增菜单', NULL, NULL, NULL, NULL, 2, 1, NULL);
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (4, 2, 'sys:menu:edit', '编辑菜单', NULL, NULL, NULL, NULL, 1, 1, 2);
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (5, 2, 'sys:menu:del', '删除菜单', NULL, NULL, NULL, NULL, 2, 1, 3);
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (6, 1, 'sys:user', '用户管理', NULL, '/system/user', NULL, NULL, 1, 1, 1);
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (7, 1, 'sys:role', '角色管理', NULL, '/system/role', NULL, NULL, 1, 1, 2);
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (8, 7, 'sys:role:create', '新增角色', NULL, NULL, NULL, NULL, 2, 1, 1);
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (9, 7, 'sys:role:edit', '编辑角色', NULL, NULL, NULL, NULL, 2, 1, 2);
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (10, 7, 'sys:role:del', '删除角色', NULL, NULL, NULL, NULL, 2, 1, 3);
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (11, 7, 'sys:role:perm', '权限控制', NULL, NULL, NULL, NULL, 2, 1, 4);
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (12, 6, 'sys:user:create', '新建用户', NULL, NULL, NULL, NULL, 2, 1, 1);
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (13, 6, 'sys:user:edit', '编辑用户', NULL, NULL, NULL, NULL, 2, 1, 2);
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (14, 6, 'sys:user:del', '删除用户', NULL, NULL, NULL, NULL, 2, 1, 3);
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (15, 6, 'sys:user:assignRole', '分配角色', NULL, NULL, NULL, NULL, 2, 1, 4);
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (16, 0, 'resource', '资源管理', NULL, '/resource', NULL, 'PictureOutlined', 0, 1, 2);
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (17, 16, 'resource:photo', '图库管理', NULL, '/resource/photo', NULL, NULL, 1, 1, 1);
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (18, 16, 'resource:video', '视频库管理', NULL, '/resource/video', NULL, NULL, 1, 1, 2);
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (19, 17, 'resource:photo:upload', '上传图片', NULL, NULL, NULL, NULL, 2, 1, 1);
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (20, 17, 'resource:photo:folder', '管理文件夹', NULL, NULL, NULL, NULL, 2, 1, 2);
INSERT INTO `sys_menu` (`id`, `parentId`, `perm`, `title`, `name`, `path`, `component`, `icon`, `type`, `status`, `sort`) VALUES (21, 17, 'resource:photo:del', '删除图片', NULL, NULL, NULL, NULL, 2, 1, 3);
COMMIT;

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键id，自增',
  `roleName` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色名称',
  `roleKey` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色标识',
  `status` tinyint(1) DEFAULT '1' COMMENT '状态 true：有效  false：冻结',
  `createById` varchar(36) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人ID',
  `createTime` datetime DEFAULT NULL COMMENT '创建时间',
  `updateById` varchar(36) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人Id',
  `updateTime` datetime DEFAULT NULL COMMENT '更新时间',
  `delFlag` tinyint(1) DEFAULT '0' COMMENT '状态 true：已删  false：未删',
  PRIMARY KEY (`id`),
  UNIQUE KEY `roleName` (`roleName`),
  UNIQUE KEY `roleKey` (`roleKey`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_role` (`id`, `roleName`, `roleKey`, `status`, `createById`, `createTime`, `updateById`, `updateTime`, `delFlag`) VALUES (1, '超级管理员角色', 'SUPER_ADMIN', 1, NULL, NULL, NULL, NULL, 0);
INSERT INTO `sys_role` (`id`, `roleName`, `roleKey`, `status`, `createById`, `createTime`, `updateById`, `updateTime`, `delFlag`) VALUES (2, '测试角色', 'TESTUSER', 1, '1', '2023-07-11 14:49:58', NULL, NULL, 0);
COMMIT;

-- ----------------------------
-- Table structure for sys_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_menu`;
CREATE TABLE `sys_role_menu` (
  `roleId` int NOT NULL COMMENT '角色id',
  `menuId` int NOT NULL COMMENT '菜单ID',
  PRIMARY KEY (`roleId`,`menuId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of sys_role_menu
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 1);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 2);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 3);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 4);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 5);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 6);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 7);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 8);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 9);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 10);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 11);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 12);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 13);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 14);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 15);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 16);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 17);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 18);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 19);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 20);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (1, 21);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (2, 1);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (2, 6);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (2, 12);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (2, 13);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (2, 14);
INSERT INTO `sys_role_menu` (`roleId`, `menuId`) VALUES (2, 15);
COMMIT;

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键id，自增',
  `username` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户名',
  `password` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '密码',
  `nickname` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '昵称',
  `mobile` varchar(11) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '手机号',
  `email` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '邮箱',
  `status` tinyint(1) DEFAULT '1' COMMENT '状态 true：有效  false：冻结',
  `userType` varchar(2) COLLATE utf8mb4_general_ci DEFAULT '1' COMMENT '0：管理员账号  1:普通账号',
  `loginIp` varchar(50) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '登录IP',
  `loginTime` datetime DEFAULT NULL COMMENT '登录时间',
  `createById` varchar(36) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人ID',
  `createTime` datetime DEFAULT NULL COMMENT '创建时间',
  `updateById` varchar(36) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新人Id',
  `updateTime` datetime DEFAULT NULL COMMENT '更新时间',
  `delFlag` tinyint(1) DEFAULT '0' COMMENT '状态 true：已删  false：未删',
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`),
  UNIQUE KEY `mobile` (`mobile`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` (`id`, `username`, `password`, `nickname`, `mobile`, `email`, `status`, `userType`, `loginIp`, `loginTime`, `createById`, `createTime`, `updateById`, `updateTime`, `delFlag`) VALUES (1, 'admin', '4297f44b13955235245b2497399d7a93', '超级管理员', '13100000000', NULL, 1, '0', '127.0.0.1', '2023-07-11 15:24:34', NULL, NULL, NULL, NULL, 0);
INSERT INTO `sys_user` (`id`, `username`, `password`, `nickname`, `mobile`, `email`, `status`, `userType`, `loginIp`, `loginTime`, `createById`, `createTime`, `updateById`, `updateTime`, `delFlag`) VALUES (2, 'testuser', '4297f44b13955235245b2497399d7a93', '测试用户', '13111111111', NULL, 1, '1', '127.0.0.1', '2023-07-11 14:50:38', '1', '2023-07-11 14:49:35', NULL, NULL, 0);
COMMIT;

-- ----------------------------
-- Table structure for sys_user_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role`;
CREATE TABLE `sys_user_role` (
  `userId` int NOT NULL COMMENT '用户ID',
  `roleId` int NOT NULL COMMENT '角色ID',
  PRIMARY KEY (`userId`,`roleId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_role` (`userId`, `roleId`) VALUES (1, 1);
INSERT INTO `sys_user_role` (`userId`, `roleId`) VALUES (2, 2);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
